// pages/index/cpns/navbar/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    txts: {
      type: Array,
      value: [
        "发现一座城，热爱一段旅",
        "一起探索城市的温度与风景",
        "附近好店好玩，社区口碑推荐",
        "周末去哪里？看城旅攻略",
        "加入城旅社区，让城市生活更好玩",
      ]
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    txt: "",
    navHeight: getApp().globalData.navHeight
  },

  lifetimes: {
    attached: function() {
      const index = Math.floor(Math.random() * this.properties.txts.length)
      this.setData({
        txt: this.properties.txts[index]
      })
    }
  }
})
